import { ResPage, Employee } from "@/api/interface/index";
import { PORT_Employee } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 员工管理模块
 */
// 获取员工列表
export const getEmployeeList = (params: Employee.ReqEmployeeParams) => {
  return http.post<ResPage<Employee.ResEmployeeList>>(PORT_Employee + `/list`, params);
};

// 保存员工
export const saveEmployee = (params: Employee.ReqEmployeeSaveParams) => {
  return http.post<Employee.ReqEmployeeSaveParams>(PORT_Employee + `/save`, params);
};

// 删除员工
export const deleteEmployee = (params: Employee.ReqEmployeeDeleteParams) => {
  return http.post<ResPage<boolean>>(PORT_Employee + `/delete`, params);
};

// 设置员工状态
export const setEmployeeStatus = (params: Employee.ReqEmployeeStatusParams) => {
  return http.post<ResPage<boolean>>(PORT_Employee + `/set-status`, params);
};

// 重置员工密码
export const resetEmployeePassword = (params: Employee.ReqEmployeeResetPasswordParams) => {
  return http.post<ResPage<string>>(PORT_Employee + `/rest-password`, params);
};
